<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../day01/js/jquery-3.7.1.min.js"></script>
</head>
<body>
    
</body>
<script>
    // $.ajax({url:'请求地址',type:'请求方式',data:{请求参数},contentType:'请求头类型',success:function(){},error:function(){}})
    //complete: function(){} 不管成功还是失败都会执行
    $.ajax({
        url:"https://showme2.myhope365.com/online_course/weChat/applet/course/list/type",
        type:"post",
        data:{ type:'free',pageNum:1,pageSize:10},
        success:function(response){
            console.log(response);
        },
        contentType:"application/x-www-form-urlencoded",
    })
    $.ajax({
        url:"https://showme2.myhope365.com/online_course/weChat/applet/subject/list",
        type:"post",
        //请求头类型为json格式时，请求参数必须为json格式
        //JSON.stringify()将对象转换为json格式字符串
        data:JSON.stringify({ enable:1}),
        success:function(response){
            console.log(response);
        },
        contentType:"application/JSON",
    })
    $.ajax({
        url:"https://showme2.myhope365.com/online_course/weChat/applet/course/banner/list?number=4",
        type:"get",
        success:function(response){
            console.log(response);
        }
    })
</script>
</html>